import 'package:flutter/material.dart';

class ImageComp extends StatelessWidget {
  const ImageComp({super.key});

  @override
  Widget build(BuildContext context) {
    return Container(
      width: 200,
      height: 400,
      decoration: BoxDecoration(
        color: Colors.green,
        borderRadius: BorderRadius.circular(200 / 2),
        // 设置网络背景图片
        image: const DecorationImage(
          image: NetworkImage(
              'https://img2.baidu.com/it/u=3643967785,2746514996&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=664'),
          fit: BoxFit.cover,
        ),
      ),
      child: Column(
        children: [
          // ClipOval 椭圆裁剪
          ClipOval(
            child: Image.network(
              'https://img2.baidu.com/it/u=3643967785,2746514996&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=664',
              fit: BoxFit.cover,
              width: 100,
              height: 100,
            ),
          ),
          // ClipRRect 圆角拆切
          ClipRRect(
              borderRadius: BorderRadius.circular(30),
              child: Image.network(
                'https://img2.baidu.com/it/u=3643967785,2746514996&fm=253&fmt=auto&app=138&f=JPEG?w=500&h=664',
                fit: BoxFit.cover,
                width: 100,
                height: 100,
              )),
          // 加载本地图片
          Image.asset(
            'assets/open_eyes.png',
            width: 100,
            height: 100,
            fit: BoxFit.cover,
          )
        ],
      ),
    );
  }
}
